package com.atguigu.guli.service.edu.controller;

import com.atguigu.guli.common.base.result.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

@CrossOrigin //解决跨域问题
@RestController
@RequestMapping("/user")
public class LoginController {

    @PostMapping("login")
    public R login(){
      return R.ok().data("token","admin");
    }
    /**
     * 获取用户信息
     */

     @GetMapping("info")
    public  R info(){
         return  R.ok().data("name","admin")
                 .data("roles","admin")
                 .data("avatar","https://aliyun_id_photo_bucket.oss.aliyuncs.com/default_handsome.jpg");

     }

    /**
     * 退出
     * @return
     */
     @PostMapping("logout")
    public R logout(){
         return  R.ok();
     }

}
